package lianxi;

//键盘录入一个字符串，去掉字母数据以及汉字等符号，保留数字数据

import java.util.Scanner;

public class test03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String line = sc.nextLine();

        char[] arr = line.toCharArray();

        for (int i = 0; i < line.length(); i++) {
            if (arr[i] >= '0' && arr[i] <= '9') {
                System.out.print(arr[i]);
            }
        }

    }
}
